package com.example.helloandroid;

import java.util.LinkedList;

import com.example.helloandroid.Card;

public abstract class Player {
	LinkedList<Card> hand;
	
	abstract boolean isHuman();
	abstract void showCards();
	
	/* Description of getMove(): Get either a player's move.
	 * For CPU: 	decide on a move, pop off cards and return them.
	 * For Player: 	have user decide on cards and return them.
	 */
	abstract LinkedList<Card> getMove(int val);
	
	int size()
	{
		return hand.size();
	}
	void assignCards(LinkedList<Card> cards)
	{
		// Changed input from array to linked list, assignment may work better
		hand = (LinkedList<Card>) cards;
		/*
		for(int i = 0; i < cards.size(); i++)
		{
			hand.add(new Card());
			hand.get(i).set(cards.get(i).getType(), cards.get(i).getValue());
		}*/
	}
	
	/* Description of isFinished(): Returns true if user has 0 cards 
	 * 								left, false otherwise.
	 * Input:	none
	 * Output: 	boolean
	 */
	boolean isFinished()
	{
		if(hand.isEmpty())
		{
			return true;
		}
		else
		{
			return false;
		}
	}
}
